package com.example.controller.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "ITEMCLIENT")
@Service
@Component
public interface InterfaceRecordFeign {
    /**
     * 获取项目编码
     * @return 项目编码
     */
    @GetMapping("/itemInfo/getProjCode")
    String getProjectCode();

    /**
     * 刷新模块接口记录
     * @param moduleName 模块名称
     * @param apiOperationList 模块接口信息集合
     * @return 返回
     */
    @PostMapping("/interfaceController/refreshModuleInterfaceRecords")
    String refreshModuleInterfaceRecords(@RequestParam("moduleName") String moduleName,
                                         @RequestBody() List<Map<String, List<String>>> apiOperationList);

    /**
     * 测试Feign调用成功
     * @param hello 无意义
     * @return 返回
     */
    @PostMapping("/interfaceController/echo")
    String echo(@RequestParam("hello") String hello);
}
